#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTime>
#include <QTimer>

#include "ui_mainwindow.h"

#include "ros/ros.h"
#include "youbot_relay/move_youbot_base_client.h"
#include "youbot_relay/move_youbot_arm_client.h"
#include "actionlib/client/simple_client_goal_state.h"


#define TESTING 0

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    explicit MainWindow(int argc, char** argv);

    ~MainWindow();

public slots:
    void log(QString msg);

public:
    bool simpleBaseTest();
    bool simpleArmTest();

private slots:
    void on_pb_test_clicked();
    void on_pb_movebase_clicked();
    void on_pb_toggle_sign_clicked();

    void on_pb_stop_clicked();
    void getState();

    void on_pb_zero_clicked();

    void on_pb_stop_arm_clicked();

    void on_pb_zero_arm_clicked();

    void on_pb_movearm_clicked();

private:
    Ui::MainWindow *ui;
    ros::NodeHandle* n;
    move_youbot_base::MoveYoubotBaseClient *client_base;
    move_youbot_arm::MoveYoubotArmClient *client_arm;
    actionlib::SimpleClientGoalState *lastState_base, *lastState_arm;
    QTimer timer1;

    /* configuration flags for different system configuration (e.g. base without arm)*/
    bool youBotHasBase, youBotHasArm;

};

#endif // MAINWINDOW_H
